﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace BusinessLayer
{
  public static class ExtensionMethods
  {
    public static string getMessage(this Exception ex)
    {
      if (ex.Message.Contains("inner exception"))
        if (ex.InnerException.Message.Contains("inner exception"))
          return ex.InnerException.InnerException.Message;
        else
          return ex.InnerException.Message;
      else
        return ex.Message;
    }
  }
}
